package org.zlex.chapter03;

import java.io.IOException;
import java.math.BigInteger;
import java.security.AlgorithmParameters;
import java.security.NoSuchAlgorithmException;

/**
 * @author : wushikai
 * <p>
 * date : 2021-04-22
 *
 * 3-7
 *
 * 这个类很少使用, 除非对 加密十分严格;
 *
 */
public class AlgorithmParametersDemo {


    private   static void info ( ) throws NoSuchAlgorithmException, IOException {


        AlgorithmParameters  ap = AlgorithmParameters.getInstance("DES");

        ap.init(  new BigInteger("19050619766489163472469").toByteArray());


        byte[] encoded = ap.getEncoded();

        System.out.println(new BigInteger(encoded).toString());
    }


    public static void main(String[] args) throws IOException, NoSuchAlgorithmException {
      info();
    }


}
